widget: Move adjusted size calculation below early-out goto
authorTimm Bäder <mail@baedert.org>
Sun, 10 May 2020 14:55:03 +0000 (16:55 +0200)
committerTimm Bäder <mail@baedert.org>
Wed, 13 May 2020 06:07:55 +0000 (08:07 +0200)
gtk/gtkwidget.c

index 479d9b6669a67476e65effa5fc0ce07fab58d976..ed6c3fc091bde7e4cf0a53bed79cbf56773e6f73 100644 (file)
@@ -3951,12 +3951,6 @@ gtk_widget_allocate (GtkWidget    *widget,
   adjusted.x += border.left + padding.left;
   adjusted.y += border.top + padding.top;
 
-  /* Since gtk_widget_measure does it for us, we can be sure here that
-   * the given alloaction is large enough for the css margin/bordder/padding */
-  adjusted.width -= border.left + padding.left +
-                    border.right + padding.right;
-  adjusted.height -= border.top + padding.top +
-                     border.bottom + padding.bottom;
   if (baseline >= 0)
     baseline -= margin.top + border.top + padding.top;
   if (adjusted.x || adjusted.y)
@@ -3971,6 +3965,13 @@ gtk_widget_allocate (GtkWidget    *widget,
   if (!alloc_needed && !size_changed && !baseline_changed)
     goto skip_allocate;
 
+  /* Since gtk_widget_measure does it for us, we can be sure here that
+   * the given alloaction is large enough for the css margin/bordder/padding */
+  adjusted.width -= border.left + padding.left +
+                    border.right + padding.right;
+  adjusted.height -= border.top + padding.top +
+                     border.bottom + padding.bottom;
+
   priv->width = adjusted.width;
   priv->height = adjusted.height;
   priv->baseline = baseline;